home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
apps
/
ibrowse
/
ibrowse.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
3KB
|
99 lines
/*
* Copyright 1993, 1994, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
ibrowse.h - Definitions for ibrowse.c, an image browser.
Tim Heidmann
Version 1.2.2
November 30, 1993
copyright 1993, Silicon Graphics
*/
#include <dirent.h>
#define MAXDIRENTS 2048
#define ICONSIZE 64
#define ICONSPACE 16384
#define MAXROWSIZE 4096
#define MAXICONS MAXDIRENTS
#define MAXIMAGEINFOLEN 64
/* Directory file info */
struct iconDirStruct {
char name[MAXNAMLEN+1];
int index, mtime, size, state, flags, iicon;
int type, subType, iType;
int xsize, ysize, zsize;
int ixsize, iysize;
};
/* File state values */
#define NOFILE 0
#define NEED2CHECK 1
#define CANTREAD 2
#define ISIMAGE 3
#define NOTIMAGE 4
#define NEED2ICONIFY 5
/* File flag bits */
#define UNREFFLAG 0
#define REFFLAG 1
#define DIRTYFLAG 2
/* Useful global variables for support routines. Don't change them! */
extern char theDirName[]; /* Full path name of current directory. */
extern char origDirName[]; /* Full path name of current working directory when
program was started. */
extern int modKeys; /* Bit fields hold state of modifier keys... */
extern int useIconFiles; /* TRUE=> Browsing file rather than directory */
#define SHIFTKEYBIT 1
#define CTRLKEYBIT 2
#define ALTKEYBIT 4
/* Structure containing image file type-specific routines:
*
* type is a unique integer ID for this image type.
*
* Check() checks file descriptor fd. If file is recognized,
* sets ids->xsize, ids->ysize, ids->zsize, and ids->subType, and returns TRUE.
*
* Iconify() opens ids->name, and creates an ABGR icon, ids->ixsize by
* ids->iysize by 32 bits deep centered in the int bitmap[ICONSIZE][ICONSIZE]
* array. Returns FALSE on any error.
*
* Info() uses the contents of ids->subType to create a description
* string in buf. A pointer to the string is returned.
*
* Open() performs the action associated with a double-click on the
* icon, usually firing up a viewer.
*
* To add support for a new image type, create versions of each of these
* routines, then add their names to the ImageFn array in ibrowse.c along
* with a unique integer image type identifier.
*/
struct ImageFnStruct {
int type;
int (*Check)(struct iconDirStruct *ids, int fd);
int (*Iconify)(struct iconDirStruct *ids, unsigned long *bitmap);
char * (*Info)(struct iconDirStruct *ids, char buf[MAXIMAGEINFOLEN]);
void (*Open)(struct iconDirStruct *ids);
};